#_*_coding:utf-8_*_

'''#read
f = file("py_home_work.csv","r")
for line in f.readlines():
    print line,
f.close()'''
#write
f = file("test2.txt", "w")
f.write("this is the first line\n")
f.write("this is second line\n")
f.write("this is third line\n")

f.close()
#append
f = file("test2.txt", "a")
f.write("this is the appendding part, i am different\n")
f.write("this is the appendding part, i am different too  ddd\n")
f.close()

#read and write : r+ w+

f = file("test2.txt","r+")
print 'first line:',f.readline()
print 'second line:',f.readline()
f.write("change third lintt")

print "third:", f.readlines()
print f.tell()
f.close()
